class Solution:
    def translateNum(self, num: int) -> int:
        s = str(num)
        n = len(s)
        dp = [0 if i > 1 else 1 for i in range(n+1)]
        for i in range(2, n+1):
            if 9 < int(s[i-2]+s[i-1]) < 26:
                dp[i] += dp[i-1]+dp[i-2]
            else:
                dp[i] += dp[i-1]
        return dp[n]
